package cn.gson.springboot.model.mapper;

import java.sql.Timestamp;
import java.util.Date;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.alibaba.fastjson.JSONArray;

import cn.gson.springboot.model.pojos.Inventory;

@Mapper
public interface IndentMapper {
	
	//查询采购订单
	public JSONArray FindAllIndent(@Param("indentid") Integer indentid,@Param("oday") String oday,@Param("tday") String tday);
	
	//根据采购单号查询采购订单详情
	public JSONArray findallindentdetails(@Param("indentid") Integer indentid);
	
	//查询待验收采购订单
	public JSONArray FindOtherIndent();
	
	//查询入库单
	public JSONArray FindAllPutInStorage(@Param("inid") Integer inid,@Param("aday") String aday,@Param("bday") String bday);
	
	//根据入库单号查询入库单单详情
	public JSONArray FindByPutInStorage(@Param("instorageid") Integer instorageid);
	
	//查询待出库单
	public JSONArray Findapply();
	
	//根据采购单号查询采购订单详情
	public JSONArray Findapplydet(@Param("drugapplyid") Integer drugapplyid);
	
	//修改订单状态
	public JSONArray updateindent(@Param("indentid") Integer indentid);
	
	//入库修改库存数量
	public JSONArray updateinven(@Param("inventorynumber") Integer inventorynumber,@Param("sum") Integer sum);		

	//查询出库单
	public JSONArray FindAlloutbound(@Param("outboundnumber") Integer outboundnumber,@Param("qday") String qday,@Param("wday") String wday);
	
	//根据出库单号查询出库详情
	public JSONArray FindByOutbound(@Param("outboundid") Integer outboundid);
	
	//修改请领状态
	public JSONArray updateapply(@Param("applyid") Integer applyid);
	
	//出库修改库存数量
	public JSONArray updatedinvent(@Param("inventorynumber") Integer inventorynumber,@Param("sum") Integer sum);		

	//出库修改请领实际数量
	public JSONArray updateaplaydis(@Param("adetailsid") Integer adetailsid,@Param("sum") Integer sum);		
	
	//查询药品详细批次
	public JSONArray selectdrugs(@Param("supplierno") Integer supplierno,@Param("days") Integer days,@Param("dada") Integer dada,@Param("dddd") Integer dddd);	
	
	//修改批次数量
	public void updatedinventpici(@Param("sum") Integer sum,@Param("inventorynumber") Integer inventorynumber,@Param("inventorypici") Integer inventorypici);
	
	//查询所有批次
	public JSONArray FindAllpici(@Param("drugnumber") Integer drugnumber);
	
	//查询所有批次数量
	public JSONArray FindAllpicisum(@Param("drugnumber") Integer drugnumber,@Param("inventorybatch") Integer inventorybatch);
	
	//退药修改库存数量
	public JSONArray updatekucun(@Param("inventorynum") Integer inventorynum,@Param("sum") Integer sum);		

	//退药修改库存详细批次数量
	public JSONArray updateinpici(@Param("inventorynum") Integer inventorynum,@Param("sum") Integer sum,@Param("batch") Integer batch);		

	//修改退药状态
	public JSONArray updatereturn(@Param("returngoid") Integer returngoid,@Param("checkpeople") String checkpeople);
		
	//销毁修改库存数量
	public JSONArray updateoutkucun(@Param("inventorynum") Integer inventorynum,@Param("sum") Integer sum);		

	//销毁修改库存详细批次数量
	public JSONArray updateoutpici(@Param("inventorynum") Integer inventorynum,@Param("sum") Integer sum,@Param("batch") Integer batch);		
	
	//修改销毁状态
	public JSONArray updatedestroy(@Param("destroyid") Integer destroyid,@Param("checkpeople") String checkpeople);
			
	//修改供应商
	public JSONArray updatedsuppliers(@Param("phone") String phone,@Param("people") String people,@Param("numb") Integer numb);
			
	//盘点
	public JSONArray drugscheck(@Param("caty") Integer caty);
	
	//盘点时间
	public JSONArray selecttake(@Param("caty") String caty);
	
	//盘点审核
	public JSONArray updatedrugscheck(@Param("name") String name,@Param("zhaiyao") String zhaiyao,@Param("times") Timestamp times,@Param("checkid") Integer checkid,@Param("jinec") Integer jinec,@Param("sumc") Integer sumc);
				
	//批次数量
	public JSONArray invensum(@Param("number") Integer number);
	
	//入库数量
	public JSONArray insum(@Param("number") Integer number,@Param("batch") Integer batch);
	
	//出库数量
	public JSONArray outsum(@Param("number") Integer number,@Param("batch") Integer batch);
	
	//退药数量
	public JSONArray returnsum(@Param("number") Integer number,@Param("batch") Integer batch);
	
	//销毁数量
	public JSONArray decisum(@Param("number") Integer number,@Param("batch") Integer batch);
	
	//新增药品判断
	public JSONArray ifdrug(@Param("name") String name ,@Param("stand") String stand ,@Param("number") Integer number,@Param("type") Integer type);
	
	//修改库存数量
	public JSONArray updatekusum(@Param("shul") Integer shul,@Param("invsum") Integer invsum,@Param("pici") Integer pici);
	
	//修改盘点数量
	public JSONArray updatetake(@Param("shijisum") Integer shijisum,@Param("slcha") Integer slcha,@Param("biaozhi") Integer biaozhi,@Param("tid") Integer tid);
	
}
